import tkinter as tk
from tkinter import ttk
import tkinter.font as tkFont
class PyWinDesign:
    def __init__(self, 启动窗口):
        self.启动窗口 = 启动窗口
        self.启动窗口.title('XiaoPE 安装工具')
        self.启动窗口.resizable(width=False, height=False)
        screenwidth = self.启动窗口.winfo_screenwidth()
        screenheight = self.启动窗口.winfo_screenheight()
        size = '%dx%d+%d+%d' % (513, 292, (screenwidth - 513) / 2, (screenheight - 292) / 2)
        self.启动窗口.geometry(size)
        
        self.按钮_刷新_标题 = tk.StringVar()
        self.按钮_刷新_标题.set('刷新')
        self.按钮_刷新 = tk.Button(self.启动窗口,textvariable=self.按钮_刷新_标题)
        self.按钮_刷新.place(x=357,y=23,width=35,height=25)
        self.BeautifyButton(self.按钮_刷新)
        
        self.组合框1 = ttk.Combobox(self.启动窗口,values=(), state='readonly')
        self.组合框1.place(x=140,y=24,width=200,height=25)
        
        self.标签1_标题 = tk.StringVar()
        self.标签1_标题.set('请选择您的U盘：')
        self.标签1 = tk.Label(self.启动窗口,textvariable=self.标签1_标题,anchor=tk.W)
        self.标签1.place(x=10,y=24,width=100,height=20)
        
        self.按钮2_标题 = tk.StringVar()
        self.按钮2_标题.set('一键制作')
        self.按钮2 = tk.Button(self.启动窗口,textvariable=self.按钮2_标题)
        self.按钮2.place(x=170,y=205,width=147,height=46)
        self.BeautifyButton(self.按钮2)
        
        self.编辑框_UD区大小 = tk.Text(self.启动窗口,wrap=tk.NONE)
        self.编辑框_UD区大小.insert(tk.END,'')
        self.编辑框_UD区大小.place(x=86,y=84,width=80,height=20)
        
        self.标签_UD区大小_标题 = tk.StringVar()
        self.标签_UD区大小_标题.set('UD区大小：')
        self.标签_UD区大小 = tk.Label(self.启动窗口,textvariable=self.标签_UD区大小_标题,anchor=tk.W)
        self.标签_UD区大小.place(x=10,y=79,width=65,height=24)
        
        self.标签_EFI区大小_标题 = tk.StringVar()
        self.标签_EFI区大小_标题.set('EFI区大小：')
        self.标签_EFI区大小 = tk.Label(self.启动窗口,textvariable=self.标签_EFI区大小_标题,anchor=tk.W)
        self.标签_EFI区大小.place(x=212,y=77,width=80,height=24)
        
        self.编辑框_EFI区大小 = tk.Text(self.启动窗口,wrap=tk.NONE)
        self.编辑框_EFI区大小.insert(tk.END,'')
        self.编辑框_EFI区大小.place(x=308,y=77,width=80,height=20)
        
        self.标签4_标题 = tk.StringVar()
        self.标签4_标题.set('写入模式：')
        self.标签4 = tk.Label(self.启动窗口,textvariable=self.标签4_标题,anchor=tk.W)
        self.标签4.place(x=10,y=126,width=80,height=24)
        
        self.组合框2 = ttk.Combobox(self.启动窗口,values=(), state='readonly')
        self.组合框2.place(x=86,y=127,width=100,height=20)
        
    def BeautifyButton(self,Button):
        Button.config(bg="#0083EE",
                                fg="white",
                                activeforeground="white",
                                activebackground="#0088FF",
                                bd=0)
        Button.bind('<Enter>', lambda self: Button.config(bg="#0F93FF"))
        Button.bind('<Leave>', lambda self: Button.config(bg="#0083EE"))
    
if __name__ == '__main__':
    root = tk.Tk()
    root.iconbitmap("Icon.ico")
    default_font = tkFont.Font(family='微软雅黑', size=9)
    root.option_add("*Font",default_font)
    app = PyWinDesign(root)
    root.mainloop()